import request from '@/utils/request'

// 获取发票管理列表
export function listInvoice(query) {
  return request({
    url: '/ord/ordinvoice/list',
    method: 'get',
    params: query
  })
}
// 通过发票号码查询产品信息
export function getDetailByNumber(query) {
  return request({
    url: '/ord/ordinvoice/getDetailByNumber',
    method: 'get',
    params: query
  })
}

// 导出发票管理列表
export function exportInvoice(data) {
  return request({
    url: '/ord/ordinvoice/export',
    method: 'post',
    data
  })
}
// 新增发票管理
export function setInvoice(data) {
  return request({
    url: '/ord/ordinvoice/save',
    method: 'post',
    data
  })
}
// 提取诺税通发票信息
export function queryFromNuonuo(data) {
  return request({
    url: '/ord/ordinvoice/queryFromNuonuo ',
    method: 'post',
    data
  })
}

//删除发票管理
export function delInvoice(data) {
  return request({
    url: '/ord/ordinvoice/delete',
    method: 'post',
    data
  })
}

//通过id获取发票管理详情
export function getInvoiceDetail(id) {
  return request({
    url: '/ord/ordinvoice/detail/' + id,
    method: 'get'
  })
}

//通过id获取发票管理详情
export function handleInvoice(id) {
  return request({
    url: '/ord/ordinvoice/handle/sync/invoice/' + id,
    method: 'get'
  })
}
//通过id获取发票管理详情
export function handleInvoiceCrm(id) {
  return request({
    url: '/ord/ordinvoice/getInvoiceToCrm/' + id,
    method: 'get'
  })
}
// 通过id获取发票管理详情
// export function getInvoiceDetail(query) {
//   return request({
//     url: '/ord/ordinvoice/detail/',
//     method: 'get',
//     params: query
//   })
// }

// 通过订单Id获取发票统计
export function getInvoiceCount(query) {
  return request({
    url: '/ord/ordorder/getInvoiceCount/',
    method: 'get',
    params: query
  })
}

// 数据导入
export function importInvoice(data) {
  return request({
    url: '/ord/ordinvoice/import',
    method: 'post',
    data
  })
}
